<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>生产派工单</title>
    <!-- Google Font: Source Sans Pro -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="../dist/css/adminlte.min.css">
    <!-- overlayScrollbars -->
    <link rel="stylesheet" href="../plugins/overlayScrollbars/css/OverlayScrollbars.min.css">
</head>
<body onload="registration()">
    <link rel="stylesheet"  href="../css/bootstrap.min.css">
    <link rel="stylesheet"  href="../css/bootstrap-table.min.css">
    <script src="../js/jquery.min.js" ></script>
    <script src="../js/bootstrap.bundle.min.js" ></script>
    <script src="../js/bootstrap.min.js"  ></script>
    <script src="../js/bootstrap-table.min.js"  ></script>
    <script src="../js/bootstrap-table-zh-CN.min.js"></script>
    <script src="../js/index.js"></script>
    <h1 style="margin-left: 40%">生产派工单</h1>
    <table id="tab">
        <tr>
            <th>工序编号</th>
            <th>工序名称</th>
            <th>描述</th>
            <th>工时数</th>
            <th>单位工时成本</th>
            <th>工时完成小计</th>
        </tr>
    </table>
        <div class="row">
            <div class="col">
                工单定制人：<input id="designer" class="form-control">
            </div>
            <div class="col">
                登记人：<input id="register" class="form-control">
            </div>
        </div>
        <div class="row">
            <div class="col">
                产品编号：<input id="productId" class="form-control">
            </div>
            <div class="col">
                产品名：<input id="productName" class="form-control">
            </div>
        </div>
        <div class="row">
            <div class="col">
                产品数量：<input id="amount" class="form-control">
            </div>
            <div class="col">
                描述：<input id="productDescribe" class="form-control">
            </div>
        </div>
        <div class="row" style="margin-left: 2%">
            备注: <textarea rows="5" cols="120">

                </textarea>
        </div>
    <button class="btn btn-outline-dark" onclick="ck()">返回</button>
    <script>
        f1()
        function f1() {
            $("#designer").val(localStorage.getItem("designer"))
            $("#register").val(localStorage.getItem("register"))
            $("#productId").val(localStorage.getItem("productId"))
            $("#productName").val(localStorage.getItem("productName"))
            $("#amount").val(localStorage.getItem("amount"))
            $("#productDescribe").val(localStorage.getItem("productDescribe"))
            $("#id").val(localStorage.getItem("id"))
            $.post("../scjh/querybyids",{"parentId":id},function (date) {
                var table=$("#tabs")
                $(data).each(function (index,item) {
                    var sum=0;
                    sum=item.labourHourAmount*item.subtotal;
                    var tr=$("<tr><td>"+item.id+"</td><td>"+item.procedureName+"</td>" +
                        "<td>"+item.procedureId+"</td><td>"+item.labourHourAmount+"</td>" +
                        "<td>"+item.subtotal+"</td><td>"+sum+"</td>" +
                        "</tr>");
                    table.append(tr);
                })
            },"json")
        }
        function ck() {
            location.href="querydispatchorders.html";
        }
    </script>
</body>
</html>